package cn.hr.utils;

import java.net.URLEncoder;

public class PhoneIndustrySMS
{
    private static String operation = "/industrySMS/sendSMS";

    private static String accountSid = PhoneConfig.ACCOUNT_SID;
    public static String to ;


    public static String code = smsCode();
    private static String smsContent = "【候景天科技】尊敬的用户，您的验证码为"+code;


    public static void execute()
    {
        String tmpSmsContent = null;
        try{
          tmpSmsContent = URLEncoder.encode(smsContent, "UTF-8");
        }catch(Exception e){

        }
        String url = PhoneConfig.BASE_URL + operation;
        String body = "accountSid=" + accountSid + "&to=" + to + "&smsContent=" + tmpSmsContent
            + PhoneHttpUtil.createCommonParam();


        String result = PhoneHttpUtil.post(url, body);
        System.out.println("result:" + System.lineSeparator() + result);
    }


    public static String smsCode(){
        String random=(int)((Math.random()*9+1)*100000)+""; 
        System.out.println("��֤�룺"+random);
        return random;
    }
}